package pers.cz.controller;

import pers.cz.pub.RespBean;
import pers.cz.websocket.MessagePushSocketUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

/**
 * @program: PostGirl-panent
 * @description: TestWebsocket
 * @author: Cheng Zhi
 * @create: 2021-10-06 22:40
 **/
@Controller
@RequestMapping("/api/testWebsocket")
public class TestWebsocket {

    @ResponseBody
    @GetMapping("/test1")
    public RespBean send() {
        MessagePushSocketUtils.sendInfo("你好前端同学",null);
        return RespBean.ok("发送成功");
    }

}
